package com.android.videotest.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;

import androidx.appcompat.app.AppCompatActivity;

import com.android.videotest.R;

public class RunnableActivity extends AppCompatActivity {
    private static final String TAG = "RunnableActivity-App";
    public static void start(Context context) {
        Intent starter = new Intent(context, RunnableActivity.class);
        context.startActivity(starter);
    }
    Handler handler = new Handler();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_runable);


        handler.postDelayed(mRunnable, 500);
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                handler.removeCallbacks(mRunnable);
            }
        }, 400);

    }


    private Runnable mRunnable = new Runnable() {
        @Override
        public void run() {
            Log.d(TAG, "run: ");
            handler.postDelayed(mRunnable, 500);
        }
    };
}
